package com.rich.common.exception;

/**
 * @Author: guofeng
 * @Date: 2021/7/19
 * @Description: 统一异常处理
 */
public class CustomException extends RuntimeException {

    private ErrorEnum errorEnum;

    public ErrorEnum getErrorEnum() {
        return errorEnum;
    }

    public void setErrorEnum(ErrorEnum errorEnum) {
        this.errorEnum = errorEnum;
    }

    public CustomException(ErrorEnum errorEnum) {
        this.errorEnum = errorEnum;
    }

    public CustomException(String message, ErrorEnum errorEnum) {
        super(message);
        this.errorEnum = errorEnum;
    }

    public CustomException(String message, Throwable cause, ErrorEnum errorEnum) {
        super(message, cause);
        this.errorEnum = errorEnum;
    }

    public CustomException(Throwable cause, ErrorEnum errorEnum) {
        super(cause);
        this.errorEnum = errorEnum;
    }

    public CustomException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, ErrorEnum errorEnum) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorEnum = errorEnum;
    }


}